package com.ffzx.commerce.framework.system.entity;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;

import com.ffzx.commerce.framework.common.persistence.DataEntity;
import com.ffzx.commerce.framework.enums.RoleDataScope;

/**
 * 角色Entity
 * 
 * @author zhugj
 * @date 2016年3月1日 下午2:03:29
 * @version 0.1.0
 */
public class SysRole extends DataEntity<SysRole> {
	
	private static final long serialVersionUID = 1L;
	
	/**
	 * 角色名称
	 */
	@NotEmpty
	@Length(min=1, max=128)
	private String name;
	
	/**
	 * 数据范围
	 */
	private String dataScope;
	
	/**
	 * 是否是可用
	 */
	private String useable;
	
	/**
	 * 用于判定用户是否分配此角色
	 */
	private String userRoleid;
	
	public SysRole() {
		super();
	}
	
	public SysRole(String id){
		super(id);
	}
	
	/*
	public SysRole(SysUser user) {
		this();
		this.user = user;
	}*/

	public String getUseable() {
		return useable;
	}

	public void setUseable(String useable) {
		this.useable = useable;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDataScope() {
		return dataScope;
	}

	public void setDataScope(String dataScope) {
		this.dataScope = dataScope;
	}
	
	public String getDataScopeInfo() {
		return RoleDataScope.valueToInfo(dataScope);
	}

	public String getUserRoleid() {
		return userRoleid;
	}

	public void setUserRoleid(String userRoleid) {
		this.userRoleid = userRoleid;
	}

}
